<template>
  <div>
    <!-- 错误提交页 2018/7/23 zhangQ -->
    <navbar></navbar>

    <div class="weui-cells__title" style="color: #000000">错误信息：</div>
    <div class="weui-cell">
      <div class="weui-cell__bd">
        <textarea class="weui-textarea" v-model="errorMsg" rows="4" style="border: solid 1px #F4F4F4"></textarea>
        <div class="weui-textarea-counter"><span>{{ errorMsg.length }}</span>/200</div>
      </div>
    </div>

    <div style="padding: 20px">
      <mu-button full-width round color="primary" @click="errorSubmit">提交</mu-button>
    </div>
  </div>
</template>

<script>
  // import {errorSubmit, stateConfirmMultiple} from '@/api/common'
  import {errorSubmit} from '@/api/common'

  export default {
    name: 'errorSubmit',
    data () {
      let errorMsg = ''
      let datas = {errorMsg}
      return datas
    },
    props: {
      id: {},
      errorState: {},
      carriageNo: {},
      trainOrderId: {}
    },
    computed: {},
    methods: {
      errorSubmit () {
        if (!(this.id && this.errorState)) {
          this.$toast.error('出现错误！')
        }
        let param = {id: this.id, errorState: this.errorState, errorMsg: this.errorMsg}
        errorSubmit(param).then(res => {
          if (+res.data.isSuccess === 1) {
            /* let submitList = [
             {
             carriageNo: this.carriageNo, // 车厢号
             trainOrderId: this.trainOrderId, // 主运单ID
             state: this.errorState
             }
             ]
             stateConfirmMultiple(submitList).then(res => {
             if (res.data.isSuccess === 1) {
             this.$toast.success('提交成功')
             this.$router.go(-1)
             } else {
             this.$toast.error('操作失败，请重试！')
             }
             }).catch() */
            this.$toast.success('提交成功')
            this.$router.go(-1)
          } else {
            this.$toast.error('出现错误！字符过长！')
          }
        }).catch()
      }
    },
    created () {
    },
    mounted () {
    },
    components: {}
  }
</script>

<style scoped>
  .weui-cell:before {
    border-top: none;
  }
</style>
